package gameoflife;

/**
 * Main class for the game of life simulation for the CS1 placement exam of
 * 2011.
 * @author CJ
 */
public class Main {

    /**
     * Main driver method for running the one dimensional game of life.
     * Command line arguments of the form:
     * Generation size,
     * Generation Simulated,
     * (Four Numbers that signify the update rules)
     * View:
     * http://www.cs.caltech.edu/courses/cs1/placement/placement-exam-cs1.html
     * for more information.
     *
     * This method creates a new GameOfLife object,
     * passes it the params, and then runs the simulation.
     *
     * @param args size, max generation, update rule 0, update rule 1,
     * update rule 2, update rule 3
     */
    public static void main(String[] args) {
        try{
            GameOfLife game = new GameOfLife(args);
            game.runSimulation();
        }catch(GameOfLifeIllegalArgumentException e){
            System.out.println(e.getMessage());
        }catch(Exception e){
            System.out.println(e.getMessage());
        }
    }

}
